<?php

/**
 *      [品牌空间] (C)2001-2010 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: common.php 5772 2011-11-02 02:04:17Z menglingmin $
 */

define('IN_BRAND', true);
define('B_ROOT', dirname(__FILE__).DIRECTORY_SEPARATOR);
define('B_VER', '2.1');
define('B_RELEASE', '20111102');
define('D_BUG', '0');
//define('SLOWTIME', '2'); //慢查询时间，毫秒

D_BUG ? error_reporting(E_ERROR) : error_reporting(0);
$_SGLOBAL = $_SBLOCK = $_SHTML = $_DCACHE = $_SGET = array();

require_once(B_ROOT.'./source/function/common.func.php');
require_once(B_ROOT.'./source/adminfunc/brandpost.func.php');
require_once(B_ROOT.'./source/class/brand.class.php');
brand::init();

// 检查关闭站点
if ($_G['setting']['siteclosed'] && !ckfounder($_G['uid']) && "update" != CURSCRIPT &&  !defined('UC_CLIENT_VERSION')) {
	if (ACTION != 'auth' && ACTION != 'seccod') {
		!$_G['setting']['siteclosed_reason'] && $_G['setting']['siteclosed_reason'] = $lang["site_close_default_reason"];
		showmessage($_G['setting']['siteclosed_reason']);
	}
}

if(!empty($_G['setting']['gzipcompress']) && function_exists('ob_gzhandler')) {
	ob_start('ob_gzhandler');
} else {
	ob_start();
}
@header('Content-Type: text/html; charset='.$_G['charset']);

// config.cache不存在将刷新页面
refreshbrandsetting();

// 读取用户组
if(!@include_once(B_ROOT.'./data/system/shopgroup.cache.php')) {
	include_once(B_ROOT.'./source/function/cache.func.php');
	updateshopgroupcache();
}

// 读取分类
$cattypes = array('region', 'shop', 'good', 'notice', 'consume', 'album', 'groupbuy');
foreach($cattypes as $cattype) {
	getcategory($cattype);
}

// 读取分类
$categorylist = $cats = $cats_plus = array();
$_G['categorylist'] = getcategory('shop');

// 读取消息
if (exists_discuz()) {
	$pm = loadClass('pm'); 
	$pm_new = $pm->pm_new;
}

// 初始化 SEO 标题
$seo_title = $_G['setting']['sitename'];
$seo_keywords = $_G['setting']['seokeywords'];
$seo_description = $_G['setting']['seodescription'];

?>
